//
//  BPComboTableViewCell.m
//  BabyPhotograph
//
//  Created by cesh on 2017/1/4.
//  Copyright © 2017年 cesh. All rights reserved.
//

#import "BPComboTableViewCell.h"

@interface BPComboTableViewCell()

@property (weak, nonatomic) IBOutlet UIView *bgView;

@end

@implementation BPComboTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    _bgView.layer.cornerRadius = 8;
    
    _bgView.layer.masksToBounds = YES;
    
//    _bgView.layer.shadowOpacity = 0.8;// 阴影透明度
//    
//    _bgView.layer.shadowColor = [UIColor colorWithRed:0x76 / 255.0 green:0xb1 / 255.0 blue:0xfd / 255.0 alpha:0.5].CGColor;// 阴影的颜色
//    
//    _bgView.layer.shadowRadius = 4;// 阴影扩散的范围控制
//    
//    _bgView.layer.shadowOffset = CGSizeMake(0, 2);// 阴影的范围
    
    CALayer *layer = [CALayer layer];
    
    layer.frame = CGRectMake(_bgView.layer.frame.origin.x, _bgView.layer.frame.origin.y, screenW / 375.0 * _bgView.layer.frame.size.width, screenW / 375.0 * _bgView.layer.frame.size.height);
//    layer.backgroundColor = [UIColor clearColor].CGColor;
    layer.backgroundColor = [UIColor colorWithRed:0x76 / 255.0 green:0xb1 / 255.0 blue:0xfd / 255.0 alpha:0.8].CGColor;
    layer.shadowColor = [UIColor colorWithRed:0x76 / 255.0 green:0xb1 / 255.0 blue:0xfd / 255.0 alpha:0.8].CGColor;
    layer.shadowOffset = CGSizeMake(0, 2);
    layer.shadowOpacity = 1.0;
    layer.shadowRadius = 3;
    layer.cornerRadius = 8;
    //这里self表示当前自定义的view
    [self.layer insertSublayer:layer atIndex:0];

    
}
    
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
